package com.haste.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Component
//熔断支持,当服务挂了之后，有异常的依然走全局降级服务，没有异常的走熔断服务
@FeignClient(value = "HYSTRIX-PAYMENT8001",fallback = HystrixServiceImpl.class)
public interface HystrixService {
    @GetMapping("/hystrix/payment/info/{id}")
    String paymentInfo(@PathVariable("id") Integer id);

    @GetMapping("/hystrix/payment/timeout/{id}")
    String paymentInfoTimeout(@PathVariable("id") Integer id);
}
